package Day18;

import java.util.Date;
import java.util.Objects;

public class Book {
    private String name;
    private double money;
    private String time;

    public Book(String name, double money, String time) {
        this.name = name;
        this.money = money;
        this.time = time;
    }

    public Book() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Book book = (Book) o;
        return Double.compare(book.money, money) == 0 &&
                Objects.equals(name, book.name) &&
                Objects.equals(time, book.time);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, money, time);
    }

    @Override
    public String toString() {
        return "Book{" +
                "name=" + name +
                ", money=" + money +
                ", time=" + time +
                '}';
    }
}
